<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>基础：5、条件渲染  v-if  v-else</title>
	<script type="text/javascript" src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
	<div id="app">
		<!-- js值为布尔型的表达式也可以作为判断的条件 -->
		<div v-if="Math.random() > 0.5">Sorry</div>
		<div v-else>Not Sorry</div>
	</div>

	<script type="text/javascript">
		var vm = new Vue({
			el: '#app'
		})
	</script>
</body>
</html>
<!-- 代码均通过测试，有什么纰漏欢迎联系 QQ:1123176978  Wechat:hyhlovehuanong -->